Define an entity

Define an entity

An entity is a grouping of things with rules or data in common. An entity often represents a group of people (eg children, applicants, stakeholders) but it can also represent a group of objects (eg textbooks), activities (eg assignments) or concepts (eg school terms).

Entities may be used to allow the same rule to be applied multiple times to make a determination. For example, you may have a rule to say that if any child of the applicant is of school age then the applicant is eligible for a tax rebate. You may collect the details of each of the person's children in order to infer whether each child is of school age, and from that infer whether or not the person is eligible.

Your rules might look something like this:

Rule 1:

the applicant is eligible for a tax rebate if

at least one of the applicant's children is of school age

Rule 2:

the child is of school age if

the child's age > 4

In this situation, the value of "the child's age" (base level) and "the child is of school age" (inferred) may be different for each instance of the child. For example:

Child 1 (Mary) Child 2 (Darryl)
the child's age = 2 the child's age = 6

the child is of school age = false

the child is of school age = true

These attributes are called entity-level attributes. Rules which use entity-level attributes are called entity-level rules.

A member of the entity group is called an entity instance. In the example above, Mary would be one instance of "the child" entity and Darryl would be another instance of "the child" entity.

What do you want to do?

Understand the different types of entities

Create an entity

Give an entity a public name

Understand the different types of entities

There are two types of entities: regular entities and the global entity.

Entities

An entity can have zero or more entity instances. For example, children in a family, applicants on an application form, taxable events in a tax period. Using entities you can apply the same rules, or collect the same data, for multiple instances of an entity.

An attribute of an entity may hold one value at a time during an investigation for each instance of the entity. That attribute may have as many values as there are instances of the entity, and will only operate within the context of that entity instance.

Global Entities

Not all information relevant to your rules may belong to a particular entity. As such, Oracle Policy Modeling has a global entity which acts as a catch-all for information that does not belong to any other entity. For example "the sun is shining" is a global attribute that does not belong to the entity "the family, "the child" and so forth.

An attribute of a global entity may only hold one value at a time during an investigation, and that value persists across the entire rulebase, common to all entities and instances of entities.

The global entity is the default location of attributes. If you do not create entities in your rulebase, or if you create an attribute which does not belong to another entity, the attribute will be stored in the global entity.

The following diagram shows how instances of a child in a family situation have entity attributes:

 

 

In the diagram, both children are in the same family and are going to the same holiday destination, but each has their own distinct properties (entity attributes), such as name, age and favorite animal.

Create an entity

Entities are defined in a properties file for the project, rather than in individual Word and Excel documents. This eliminates the need to re-define the same entities in each rule file.

To add an entity to a properties file:

  1. In Oracle Policy Modeling, double-click the properties file in the Project Explorer. The file will open in the right hand pane.
  2. Right-click on the Global entity (or other parent entity) in the Entities tab and select New Entity.
  3. Type a name for the new entity, then press Enter. TIP: Entities should be named using the definite article 'the', eg 'the family', 'the child', 'the friend', 'the school' etc.

 

The entity that you have added will now be displayed in the left-hand pane of the properties file:

 

 

After you have defined an entity in this way, every attribute which uses the exact entity text (eg 'the child') becomes an entity-level attribute belonging to that entity.

When an entity is created:

  1. a containment relationship is automatically created for the new entity, to ensure that the containment structure in the rulebase data model is well-defined, and
  2. an identifying attribute is automatically created for the new entity (see below).

Identifying attributes

The identifying attribute for an entity is the text attribute whose value is used for labeling instances of the entity in decision reports, Web Determinations and the debugger. So for example, if you had 'the child' text attribute as the identifying attribute for the entity 'the child', then after you have set values for 'the child' attribute (eg, 'Reid', 'Cohen' and 'Emery'), the child entity instances would be labeled accordingly.

 

 

As mentioned earlier, an identifying attribute is automatically created when a new entity is created.

 

 

By default, this text attribute has:

 

If you want to change any of these default settings you will need to edit the attribute. To do this:

  1. In Oracle Policy Modeling, double click the properties file in the Project Explorer to open it for editing.
  2. In the left hand pane, select the entity that the attribute belongs to.
  3. On the Attributes tab in the right hand pane, double click the identifying attribute to open the Attribute Editor.
  4. Make the necessary changes to the attribute.



  5. Click OK.

 

To change the attribute that is used to identify an entity (or to specify one if there isn't one):

  1. In Oracle Policy Modeling, double-click the properties file in the Project Explorer. The file will open in the right hand pane.
  2. Double click the entity to open the Edit Entity dialog.
  3. Click the browse button next to the Identifying attribute field.
  4. In the Attribute Selector, select the appropriate attribute, then click OK.
  5. Click OK again to close the Edit Entity dialog.

Give an entity a public name

You can define a public name for your entity in the same way as you can define a public name for an attribute of an entity. The public name overrides the entity text. You should define a public name for an entity when the entity name in the data model differs from the entity name in the source material.

To define a public name for an entity, do the following:

  1. In Oracle Policy Modeling, double-click the properties file in the Project Explorer. The file will open in the right hand pane.
  2. Double click the entity to open the Edit Entity dialog.
  3. Enter a public name. Then click OK.

 

See also: